package chapter02.item01;

import java.lang.reflect.InvocationTargetException;

/**
 * @author zhaoyuqiang
 * @date 2021年09月22日 16:21
 * @description 对简单静态工厂进行测试
 */
public class FoodTest {
    public static void main(String[] args) {
        Food fish = null;
        try {
            fish = FoodFactory.getFood("Fish");
        } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
            e.printStackTrace();
        }
        assert fish != null;
        fish.introduce();
    }
}
